package asteroids;

import be.kuleuven.cs.som.annotate.Basic;

public class Thruster {
	private final double outputForce;
	private boolean enabled;

	/**
	 * Creates a new disabled thruster with the standard output value of
	 * 1.1*10^18 N/s
	 */
	public Thruster() {

		this.outputForce = 1100000000000000000.0;
		this.enabled = false;
	}

	/**
	 * Creates a new disabled thruster with the given output value in N/s
	 * 
	 * @param output
	 *            The output value of the new thruster in N/s
	 */
	public Thruster(double output) throws IllegalArgumentException{
		if (Double.isNaN(output)) {
			throw new IllegalArgumentException();
		} else {
			this.outputForce = output;
		}
		this.enabled = false;
	}

	/**
	 * 
	 * @return |result == this.enabled
	 */
	@Basic
	public boolean getThrusterStatus() {
		return this.enabled;
	}

	/**
	 * 
	 * @param newStatus
	 * @post (new this).getThrusterStatus() == newStatus           
	 */
	@Basic
	public void setThrusterStatus(boolean newStatus) {
		this.enabled = newStatus;
	}

	/**
	 * 
	 * @return |result == this.outputforce
	 */
	@Basic
	public double getOutputForce() {
		return this.outputForce;
	}

}
